<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MOTORMARKET TV</title>
<style type="text/css">
<!--
body {
	background-image: url(images/BG.jpg);
	background-color: #000;
}
#contenedor {
top: 0px; 
}
body,td,th {
	color: #000;
}
#logo_video{
  position: relative;
  z-index:0;
  color:#FFF;
  left: 15px;
  top: -250px; 
  }

-->
</style>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24028399-4']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<script language="JavaScript" src="visits.js"></script>
</head>
 <?php 
 error_reporting(0);
 $a=$_GET['a'];
require("db.php");
$root="http://".$_SERVER['HTTP_HOST'];
    $sqlAct = "SELECT actividad FROM canales WHERE canal='http://motormarket.com.mx/' LIMIT 1";
    $resultNumA = mysql_query($sqlAct);
    $rowA = mysql_fetch_array($resultNumA);
    $actividad=$rowA['actividad'];
    /*query video*/
    $sqlRan = "SELECT id FROM videos WHERE canal='http://motormarket.com.mx/' and activo='yes' ORDER BY rand() LIMIT 1";
    $resultNum4 = mysql_query($sqlRan);
    $row4 = mysql_fetch_array($resultNum4);
$i=$row4['id'];
  $result = mysql_query("SELECT * FROM videos WHERE id=$i");
  $row = mysql_fetch_array($result);
?> 
<?php if($actividad=='random'){?>
<meta http-equiv="Refresh" content="<?php echo $row['tiempo']; ?>;url=<?php echo $root."/index_UsEm.php"; ?>">
<?php } else { ?>

<?php } ?>
<body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
<?php if($actividad=='random'){?>
   <div id="contenedor"><iframe width="415" height="280"src="<?php echo $row['url']; ?>?v=3&amp;wmode=direct&autoplay=true&volume=50" scrolling="no" frameborder="0" marginwidth="0" marginheight="0"></iframe></div>
<?php } else { ?>
  <div id="contenedor"><iframe  width="415" height="280" src="http://www.ustream.tv/embed/8687321?autoplay=true" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" ></iframe></div>
<?php } ?>
<div id="logo_video"><img src="motormarket.png"></div>
</body>
</html>